﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using Fiveesoft.Utility;
using NLUNZ.Business;

namespace NLUNZ.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Logon_Click(object sender, EventArgs e)
        {
            LoginChecker();
        }
        private void LoginChecker()
        {
            MessageBag message = Repository.MembershipAuthentication(UserEmail.Text, Password.Text);
            if (message.Verified)
            {
                FormsAuthentication.RedirectFromLoginPage
                   (UserEmail.Text, false);
            }
            else
            {
                FailureText.InnerHtml = message.ErrorMessage;
            }
        }

        //protected void lnkRegister_Click(object sender, ImageClickEventArgs e)
        //{
        //    Response.Redirect("~/Register/Default.aspx");
        //}

        //protected void lnkPassword_Click(object sender, ImageClickEventArgs e)
        //{
        //    Response.Redirect("~/Register/ResetPassword.aspx");
        //}


    }
}